package com.tarena.xxl.job.demo.job;

import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MyFirstJob {

    @Value("${server.port}")
    private String port;

    @XxlJob(value = "job01")
    public void execute01(){
        log.info("第一个定时任务执行了,执行任务的进程端口:{}",port);
    }

    @XxlJob(value = "job02")
    public void execute02(){
        log.info("第二个定时任务执行了,执行任务的进程端口:{}",port);
    }
}
